<?php
class CourseProject extends Zend_Db_Table
{
	protected $_name ="course_project";
	protected $_primary = 'id';

 //根据id 查询course_project
    public function getcourse_projectByid($id){
          $select = $this->select();
          $select->where("id=".$id);
          return $this->fetchAll($select)->toArray();
    }


 //根据course_id 查询course_project
    public function getcourse_projectBycourse_id($course_id){
          $select = $this->select();
          $select->where("course_id=".$course_id);
          return $this->fetchAll($select)->toArray();
    }

 //更新course_project
    public function updatecourse_projectByid($array,$id){

		$db = $this->getAdapter();
		$where=$db->quoteInto('id = ?', $id);
		$this->update($array, $where);
	}
//删除course_project
     public function delcourse_projectByid($id){
          $where = 'id = '. $id;
         $this->delete($where);
         return true;
    }

//根据project_id和case_id删除projectcase
     public function delcourseprojectByprojectid($project_id,$course_id){
          $where = "project_id='$project_id' and course_id='$course_id'";
         $this->delete($where);
         return true;
    }
}

